package EjerciciosNoBoletin1.Ex1;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.*;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.*;

public class ScrollDemo extends JFrame {

	private JPanel panel;
    public ScrollDemo() {
        ImageIcon image = new ImageIcon("youngdad.jpeg");

        panel = new JPanel();
        JLabel label = new JLabel(image);
        
        panel.add(label);
        
        JScrollPane scroll = new JScrollPane(panel);
        getContentPane().add(scroll);

        this.setTitle("ScrollPane");
        this.pack();
        this.setVisible(true);
    }


    public static void main(String s[]) {
      ScrollDemo sd = new ScrollDemo();
        
    }
}